<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>链接管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/themes/admin/css/font.css">
    <link rel="stylesheet" href="/themes/admin/css/xadmin.css">
    <link rel="stylesheet" href="/themes/admin/css/common.css">
    <script src="/themes/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/themes/admin/js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="x-nav">
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>系统信息</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>当前版本：TnCMS-v{$version}
                                {eq name="upgrate" value="1"}
                                <button type="button" onclick="systemUpdate(this)" class="layui-btn layui-btn-danger" style="height: 20px;line-height: 20px;">
                                    <i class="layui-icon">&#xe681;</i>有新的版本，点此升级
                                </button>
                                {/eq}
                                {eq name="upgrate" value="0"}
                                <span style="color: #09d09a">已是最新版本</span>
                                {/eq}
                            </td>
                        </tr>
                        <tr>
                            <td>云平台通信
                                {eq name="cloudStatus" value="1"}
                                <button type="button" class="layui-btn layui-btn-normal" style="height: 20px;line-height: 20px;">通讯正常</button>
                                {/eq}
                                {eq name="cloudStatus" value="0"}
                                <span style="color: red">【通讯错误】</span>
                                {/eq}
                            </td>
                        </tr>
                        <tr>
                            <td>授权域名：{$Request.host}
                                {eq name="domainStatus" value="1"}
                                <span style="color: #09d09a">【已授权商业使用】</span>
                                {/eq}
                                {eq name="domainStatus" value="0"}
                                <span style="color: red">【未授权，商业使用需保留底部版权】</span>
                                {/eq}
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use("layer")
    function systemUpdate(obj) {
        $(obj).attr("disabled","disabled");
        $(obj).addClass("layui-btn-disabled");
        $(obj).removeClass("layui-btn-danger");
        $(obj).html('<i class="layui-icon">&#xe63d;</i>升级中');
        $.ajax({
            type:"POST",
            url:"/system/upgrade/systemInstall",
            success:function (e) {
                if (e.code == 1){
                    location.reload();
                }
            }
        })
    }
</script>
</html>